package cn.com.huzo.model.entities.purchase;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 采购跟单日记表主记录实体类
 * <p>
 * @author 范学春
 */
public class PoTrackingDiaryHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3403872043466979770L;
    private Long HeaderId;
    private String NoOfBill;               // 单据号
    private Timestamp DateOfBillStart;     // 跟单起始日期
    private Timestamp DateOfBillEnd;       // 跟单结束日期
    private Long BuyerId;                  // 采购业务员
    private String BuyerIdName;
    private String Description;            // 备注

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getNoOfBill() {
        return NoOfBill;
    }

    public void setNoOfBill(String NoOfBill) {
        this.NoOfBill = NoOfBill;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfBillStart() {
        return DateOfBillStart;
    }

    public void setDateOfBillStart(Timestamp DateOfBillStart) {
        this.DateOfBillStart = DateOfBillStart;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfBillEnd() {
        return DateOfBillEnd;
    }

    public void setDateOfBillEnd(Timestamp DateOfBillEnd) {
        this.DateOfBillEnd = DateOfBillEnd;
    }

    public Long getBuyerId() {
        return BuyerId;
    }

    public void setBuyerId(Long BuyerId) {
        this.BuyerId = BuyerId;
    }

    public String getBuyerIdName() {
        return BuyerIdName;
    }

    public void setBuyerIdName(String BuyerIdName) {
        this.BuyerIdName = BuyerIdName;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof PoTrackingDiaryHeaderEntity)) {
            return false;
        }

        final PoTrackingDiaryHeaderEntity that = (PoTrackingDiaryHeaderEntity) o;

        return new EqualsBuilder()
            .append(this.getHeaderId(), that.getHeaderId())
            .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
